#pragma once
#include <QMainWindow>
#include <QMutex>
#include <QWaitCondition>
#include <QTimer>

QT_BEGIN_NAMESPACE
namespace Ui { class MainWindow; }
QT_END_NAMESPACE

class CameraThread;

class MainWindow : public QMainWindow
{
    Q_OBJECT
public:
    explicit MainWindow(QWidget *parent = nullptr);
    ~MainWindow();

private slots:
    void onStart();
    void onStop();
    void triggerCapture();
    void updateCam0(const QImage &img);
    void updateCam1(const QImage &img);

private:
    Ui::MainWindow *ui;

    QMutex m_mutex;
    QWaitCondition m_trigger;
    CameraThread *m_cam0 = nullptr;
    CameraThread *m_cam1 = nullptr;
    QTimer *m_timer = nullptr;
};
